from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired, Length, Optional, Email


class OrdersForm(FlaskForm):
    nickname = StringField('昵称', validators=[Optional(), Length(1, 255)], render_kw={'placeholder': '昵称'})
    price = StringField('金额', validators=[DataRequired('金额不能为空')], render_kw={'placeholder': '金额'})
    email = StringField('邮件', validators=[DataRequired('标题不能为空')], render_kw={'placeholder': '邮箱'})
    messages = StringField('留言', validators=[Optional(), Length(1, 255)])
    submit = SubmitField('提交')
